<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="../includes/importer.jsp"%>
<!doctype html>
<html>
    <head>
        <ht:head/>
    </head>
<body>
<br/>
<div id="search-menu">
    <ul>
        <ht:menu-btn type="search"/>
        <ct:display model="itemsale_list" btn="add_btn">
            <ht:menu-btn text="添加商品" url="/itemsale/add" type="add"/>
        </ct:display>
    </ul>
    <br style="clear: left" />
</div>
<div class="queryContainer" >
    <form name="queryForm" id="queryForm" action="list" method="get">
        <table>
        	<tr>
        		  <td>商品编号：</td>
                <td><input type="text" name="id" value="${param.id}" class="txt" style="width:206px"/></td>
                <td>是否物流：</td>
                <td>
                	<select name="postFlag">
                   	<option value>--请选择--</option>
                   	<c:forEach items="${postFlagMap }" var="postFlagM">
                   		<option value="${postFlagM.key }" <c:if test="${param.postFlag==postFlagM.key }">selected</c:if>>${postFlagM.value }</option>
                   	</c:forEach>
                   </select>
                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   审核状态：<select name="status">
                   	<option value>--请选择--</option>
                   	<c:forEach items="${auditStatusMap }" var="auditStatusM">
                   		<option value="${auditStatusM.key }" <c:if test="${param.status==auditStatusM.key }">selected</c:if>>${auditStatusM.value }</option>
                   	</c:forEach>
                   </select>
                </td>
                <td>上架状态：</td>
                <td>
                	<select name="saleStatus">
                   	<option value>--请选择--</option>
                   	<c:forEach items="${saleStatusMap }" var="saleStatusM">
                   		<option value="${saleStatusM.key }" <c:if test="${param.saleStatus==saleStatusM.key }">selected</c:if>>${saleStatusM.value }</option>
                   	</c:forEach>
                   </select>
                </td>
            	
            </tr>
        
            <tr>
              
               
            </tr>
            
            <tr>
             <td>商品名称：</td>
                <td><input type="text" name="name" value="${param.name}" class="txt" style="width:206px"/></td>
            <td width="65">创建时间：</td> 	
				<td width="300">
                    <input type="text" id="inputStartTimeS" name="inputStartTimeS" value="${param.inputStartTimeS}" class="txt Wdate"
                           readOnly onfocus="WdatePicker({vel:'createTime',realDateFmt:'yyyyMMdd',maxDate:'#F{$dp.$D(\'inputStartTimeS\')||\'2020-10-01\'}'})" />
                    <input type="hidden" name="createTime" id="createTime" value="${param.createTime}"/>
                   	 至
                    <input type="text" id="inputEndTimeS" name="inputEndTimeS" value="${param.inputEndTimeS}" class="txt Wdate"
                           readOnly onfocus="WdatePicker({vel:'cerateTimeEnd',realDateFmt:'yyyyMMdd',minDate:'#F{$dp.$D(\'inputEndTimeS\')}',maxDate:'2020-10-01'})" />
                    <input type="hidden" name="cerateTimeEnd" id="cerateTimeEnd" value="${param.cerateTimeEnd}" />
                </td>
                <td width="65">销售时间：</td> 	
				<td width="300">
                    <input type="text" id="inputSaleStartTimeS" name="inputSaleStartTimeS" value="${param.inputSaleStartTimeS}" class="txt Wdate"
                           readOnly onfocus="WdatePicker({vel:'saleStartTime',realDateFmt:'yyyyMMdd',maxDate:'#F{$dp.$D(\'inputSaleStartTimeS\')||\'2020-10-01\'}'})" />
                    <input type="hidden" name="saleStartTime" id="saleStartTime" value="${param.createTime}"/>
                   	 至
                    <input type="text" id="inputSaleEndTimeS" name="inputSaleEndTimeS" value="${param.inputSaleEndTimeS}" class="txt Wdate"
                           readOnly onfocus="WdatePicker({vel:'saleStopTime',realDateFmt:'yyyyMMdd',minDate:'#F{$dp.$D(\'inputSaleEndTimeS\')}',maxDate:'2020-10-01'})" />
                    <input type="hidden" name="saleStopTime" id="saleStopTime" value="${param.cerateTimeEnd}" />
                   
                </td>
            </tr>
            <tr> 
            	<td colspan="6"><ct:btn type="search" /></td>
            </tr>
        </table>
    </form>
</div>
<div class="container">
    <br/>
    <h3>商品列表</h3>
    <div class="mainbox">
        <c:if test="${not empty pageData}">


        <table class="datalist fixwidth">
            <tr>
                <th nowrap="nowrap" width="20">商品编号</th>
                <th nowrap="nowrap" width="50">商品名称</th>
                <th nowrap="nowrap" width="50">商品分类</th>
                <th nowrap="nowrap" width="70">创建时间</th>
                <th nowrap="nowrap" width="30">审核状态</th>
                <th nowrap="nowrap" width="30">上下架状态</th>
                <th nowrap="nowrap" width="30">售价</th>
                <th nowrap="nowrap" width="20">是否物流</th>
                <th nowrap="nowrap" width="30">创建人</th>
                <th nowrap="nowrap" width="80">操作</th>
            </tr>

            <c:forEach items="${pageData.data}" var="item">
            <tr>
                <td nowrap="nowrap">${item.id}</td>
                <td nowrap="nowrap">${item.name}</td>
                <td nowrap="nowrap">${item.typeName}</td>
                <td nowrap="nowrap"><ct:time tfmt="yyyy-MM-dd hh:mm:ss" source="${item.createTime}"/></td>
                <td nowrap="nowrap">${auditStatusMap[item.status] }</td>
                <td nowrap="nowrap">
	                <c:if test="${item.saleStatus==0}">未上架</c:if>
	                <c:if test="${item.saleStatus==1}">已上架</c:if>
                </td>
                <td nowrap="nowrap" width="100">${item.shopPrice}</td>
                 <td nowrap="nowrap">
	                <c:if test="${item.postFlag==0}">否</c:if>
	                <c:if test="${item.postFlag==1}">是</c:if>
                </td>
                <td nowrap="nowrap">${item.createUserId}</td>
                <td nowrap="nowrap">
                   <ct:display model="itemsale_list" btn="view_btn">
					 	<a href="view/${item.id}"  class="view">详情</a>&nbsp; &nbsp;
					</ct:display>
					
					<c:if test="${item.status == 0||item.status == 2}">
						<ct:display model="itemsale_list" btn="audit_btn">
								  <a href="audit?id=${item.id}">审核</a> &nbsp; &nbsp;
                       	</ct:display>
					</c:if>
					<ct:display model="itemsale_list" btn="mod_btn">
						<a href="edit/${item.id}">编辑</a>&nbsp; &nbsp;
					</ct:display>
					
                    <c:if test="${item.status == 3&&item.saleStatus == 0}">
					     <ct:display model="itemsale_list" btn="putaway_btn">
	                        <a href="#" onclick="dealInfo('确定要上架吗？','ruing/${item.id}/1');">上架</a>&nbsp;&nbsp;
	                    </ct:display>
					</c:if>
                    <c:if test="${item.status == 3&&item.saleStatus == 1}">
					     <ct:display model="itemsale_list" btn="sold_out_btn">
	                        <a href="#" onclick="dealInfo('确定要上架吗？','ruing/${item.id}/2');">下架</a>&nbsp;&nbsp;
	                    </ct:display>
					</c:if>
					
					<ct:display model="itemsale_list" btn="del_btn">
             			<a href="#this" onclick="deleteItem(' ${ctx}/itemsale/delete/${item.id}');">删除</a>
                   	</ct:display>
                </td>
            </tr>
            </c:forEach>
        </table>

        <ht:page pageData="${pageData}" />

        </c:if>
        <c:if test="${empty pageData}">
        <div class="note">
            <p class="i">目前没有相关记录!</p>
        </div>
        </c:if>
    </div>

</div>

</body>
</html>